package org.tity.test.awesome;

import java.io.File;
import java.util.HashMap;

import org.tity.commons.environment.PathTool;

import jodd.io.FileUtil;

public class Awesome {
	
	public static void main(String[] args) throws Exception {
		String path= PathTool.getDir(Awesome.class).getAbsolutePath()+File.separator+"font-awesome-4.7.0/css/font-awesome.css";
		String css=FileUtil.readString(path);
		String[] lines=css.split("\n");
		String cssName="",hex="";
		String cssNames="";
		HashMap<String, String> map=new HashMap<String, String>();
		
		int i=0,ni=0;
		for (String ln : lines) {
			i++;
			ln=ln.trim();
			int z=ln.indexOf(":before");
			if(z!=-1  && ln.startsWith(".") && ln.endsWith("{"))
			{
				ni=i;
				
				cssName=ln.substring(1, z);
				
				System.out.println(i+"\t\t"+cssName);
				
				cssNames+=cssName+",";
				
			}
			
			if(ln.startsWith("content"))
			{
				if(i-ni>3)
				{
					System.err.println();
				}
				else
				{
					z=ln.indexOf("\"");
					ni=ln.lastIndexOf("\"");
					hex=ln.substring(z+2, ni);
					hex="x"+hex;
					System.out.println(i+"\t"+(i-ni)+"\t\t"+hex);
					map.put(cssName, hex);
				}
			}
 
		}
		
		System.out.println(cssNames);
		
	}
	

}
